import com.User;
import com.UserController;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * com.User: 666
 * Date: 2023-07-19
 * Time: 0:01
 */
public class Test {
    public static void main(String[] args) {
        //获取spring上下文
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring-config.xml");
        //获取指定的Bean对象名称+类型进行获取
        UserController userController = applicationContext.getBean(UserController.class);
      userController.getUser().sayHi("zcx");
    }
}
